package com.cafe.model;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;
import javax.persistence.Table;

import org.hibernate.annotations.Filter;
import org.hibernate.annotations.Where;

import com.malamute.core.entity.BaseEntity;

/**
 * @description 商品目录实体
 * @version v1.0
 */
@Entity
@Table(name = "T_CAFE_PRODUCTCATEGORY")
public class ProductCategory extends BaseEntity {
	private String name;// 菜单类型
	private int orderNum;// 排序字段

	@OneToMany(targetEntity = Product.class, mappedBy = "productCategory")
	@OrderBy(value = "id")
	@Where(clause = "isSoldOut=0")
	private Set<Product> products;// 菜单

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public int getOrderNum() {
		return orderNum;
	}

	public void setOrderNum(int orderNum) {
		this.orderNum = orderNum;
	}

	public Set<Product> getProducts() {
		return products;
	}

	public void setProducts(Set<Product> products) {
		this.products = products;
	}

}
